<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Api_login extends CI_Controller
{   
    function __construct(){
        parent::__construct();		
        $this->load->model('api_mlogin');
    }

    public function index()
    {
		//Check parameter validity
		if($this->input->post('json_post')){
			//Decode the json
			$post=json_decode($this->input->post('json_post'));
			$return = $this->api_mlogin->login($post['username'], $post['password']);
			echo json_encode($return);
		}else{
			echo 'Parameter tidak lengkap';
		}	
    }  

}